package com.example.phoneshop.service.impl;

import com.example.phoneshop.dao.ProductsDao;
import com.example.phoneshop.entity.Products;
import com.example.phoneshop.service.ProductsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class ProductsServiceImpl implements ProductsService {
    private final ProductsDao productsDao;

    @Autowired
    public ProductsServiceImpl(ProductsDao productsDao){
        this.productsDao=productsDao;
    }

    @Override
    public Products findProductsById(int id){return productsDao.findProductsById(id);}

    @Override
    public Products selectProductByName(String name){return productsDao.selectProductByName(name);}

    @Override
    public List<Map> findProducts(){ return productsDao.findProducts();}
}
